import { defHttp } from "@/utils/http";
// ERP 供应商组 VO
export interface SuplerGroupVO {
	id: number; // 供应商组编号
	name: string; // 供应商组名称
	parentId: number; // 父级ID
	sqNumb: number; // 排序号
	status: string; // 状态
}

// ERP 供应商组 API
export const SuplerGroupApi = {
	// 查询供应商组分页
	getSuplerGroupPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/supler-grp/page`, params });
	},

	// 查询供应商组详情
	getSuplerGroup: async (id: number) => {
		return await defHttp.get({ url: `/whs/supler-grp/get?id=` + id });
	},

	// 新增供应商组
	createSuplerGroup: async (data: SuplerGroupVO) => {
		return await defHttp.post({ url: `/whs/supler-grp/create`, data });
	},

	// 修改供应商组
	updateSuplerGroup: async (data: SuplerGroupVO) => {
		return await defHttp.put({ url: `/whs/supler-grp/update`, data });
	},

	// 删除供应商组
	deleteSuplerGroup: async (id: number) => {
		return await defHttp.delete({ url: `/whs/supler-grp/delete?id=` + id });
	},

	// 导出供应商组 Excel
	exportSuplerGroup: async (params: any) => {
		return await defHttp.download({ url: `/whs/supler-grp/export-excel`, params });
	}
};
